<template>
  <div class="big-catEyeMovie">
    <div class="catEyeMovie">
      <div class="header">
        <div class="header-left">
          <div class="header-left-title">猫眼电影</div>
          <div class="header-left-secondary">
            <span class="left-secondary-word">正在热映</span>
            <span class="left-secondary-word">即将上映</span>
          </div>
          <div class="select-icon"></div>
        </div>
        <div class="header-right">
          <div class="header-right-text">全部</div>
          <i class="iconfont icon-youjiantou"></i>
        </div>
      </div>
      <div class="content">
        <div class="content-container">
          <div
            class="single-content"
            v-for="carouselChart in carouselChart"
            :key="carouselChart.index"
          >
            <img :src="carouselChart.img" alt="" />
            <div class="single-content-text">
              <div class="content-text-top">
                <em>{{ carouselChart.wish }}</em
                >人想看
              </div>
              <div class="content-text-bottom">{{ carouselChart.nm }}</div>
            </div>
          </div>
          <div class="icon-management">
            <button class="jiantou-left">
              <i
                class="iconfont icon-youjiantou icon-left"
                style="font-size: 50px"
              ></i>
            </button>
            <button class="jiantou-right">
              <i
                class="iconfont icon-youjiantou icon-right"
                style="font-size: 50px"
              ></i>
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "catEyeMovie",
};
</script>

<script setup>
import { getCatEyeMovies } from "../../api/outFood/index";
import { onMounted, ref } from "vue";
const carouselChart = ref([]);
onMounted(async () => {
  const result = await getCatEyeMovies();
  carouselChart.value = result.data.hot;
});
</script>

<style scoped>
.swiper-container {
  width: 100%;
  height: 300px;
  margin: 50px auto;
}
.swiper-slide {
  background: #f1f1f1;
  color: #000;
  text-align: center;
  line-height: 300px;
}
* {
  margin: 0 auto;
}
.big-catEyeMovie {
  background-color: #f8f8f8;
}
.catEyeMovie {
  width: 1200px;
}
.header {
  background-color: #fe4550;
  width: 1185px;
  height: 44px;
  border-radius: 10px 10px 0 0;
  display: flex;
}
.header-left {
  display: flex;
  align-items: center;
  position: relative;
}
.header-left-title {
  font-size: 18px;
  position: absolute;
  left: -275px;
  color: #f8f8f8;
}
.header-left-secondary {
  width: 300px;
  font-size: 15px;
  position: absolute;
  left: -183px;
  color: #f8f8f8;
}
.left-secondary-word {
  margin-right: 10px;
}
.select-icon {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #f8f8f8;
  border-radius: 2px;
  position: absolute;
  bottom: 0;
  left: -164px;
}

.header-right {
  display: flex;
  align-items: center;
  position: relative;
}
.header-right-text {
  font-size: 15px;
  color: #f8f8f8;
  width: 30px;
  position: absolute;
  right: -260px;
}
.header-right .icon-youjiantou {
  position: absolute;
  right: -277px;
  color: #f8f8f8;
  cursor: pointer;
}
.content {
  display: flex;
  width: 2200px;
  margin-top: 3px;
  cursor: pointer;
}
.content-container {
  display: flex;
  justify-content: flex-start;
  width: 1176px;
  margin: 0 8px;
  padding-right: -10px;
  overflow: hidden;
}
.single-content {
  margin: 0 7px;
  position: relative;
}
.single-content img {
  width: 215px;
  height: 295px;
  border: 1px solid transparent;
  border-radius: 5px 5px 0 0;
}
.single-content-text {
  position: absolute;
  bottom: 15px;
  color: #f8f8f8;
}
.content-text-top {
  font-size: 13px;
  margin-left: 12px;
}
.content-text-top em {
  color: #fd9827;
  font-size: 18px;
}
.content-text-bottom {
  font-size: 17px;
  width: 90px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-left: 12px;
}
.content-container button {
  font-size: 16px;
}
.content-container .icon-right {
  cursor: pointer;
  position: absolute;
  right: 195px;
  top: 167px;
}
.content-container .icon-left {
  cursor: pointer;
  position: absolute;
  left: 195px;
  top: 167px;
}
</style>